package com.rd.student.jike.class2.lihongming.week724_730.Day728.DecoratorMode;

/**
 * @Auther:Heinrich
 * @Date:2023/7/28-07-28-14:28
 * @Description:c230728
 * @version:1.0
 */
//饮料
public abstract class Drink {
    //价格
    private double price;
    //描述
    private String desc;

    //花费
    public abstract double cost();

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
class Coffee extends Drink{
    //将饮品本身的价格作为花费
    @Override
    public double cost() {
        return super.getPrice();
    }
}

class MeiShi extends Coffee{
    public MeiShi() {
        super.setPrice(12.99);
        super.setDesc("这是一杯美式");
    }
}
class latte extends Coffee{
    public latte() {
        super.setPrice(15.99);
        super.setDesc("这是一杯拿铁");
    }
}
class black extends Coffee{
    public black() {
        super.setPrice(10.99);
        super.setDesc("这是一杯纯咖啡");
    }
}